<nz-drawer [nzClosable]="false" [nzVisible]="visible" nzPlacement="right" nzWidth="500px" nzTitle="设备组"
           [nzFooter]="footerTpl"
           (nzOnClose)="close()">
  <form nz-form nzLayout="vertical" [formGroup]="validateForm" (ngSubmit)="submitForm()">

    <nz-form-item>
      <nz-form-label nzFor="code"> 编号</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleCode!">
        <input nzSize="small" nz-input id="code" formControlName="code" [readOnly]="isUpdate"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="name"> 名称</nz-form-label>
      <nz-form-control nzErrorTip="Please input your roleName!">
        <input nzSize="small" nz-input id="name" formControlName="name"/>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="status"> 状态</nz-form-label>
      <nz-form-control>
        <nz-select nzSize="small" nzPlaceHolder="Select a status" formControlName="status" id="status">
          <nz-option nzLabel="启用" [nzValue]=1></nz-option>
          <nz-option nzLabel="禁用" [nzValue]=0></nz-option>
        </nz-select>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="memo"> 备注</nz-form-label>
      <nz-form-control
        [nzValidateStatus]="validateForm.controls['memo']"
        nzErrorTip="Please input your phone url!"
      >
        <textarea nzSize="small" formControlName="memo" id="memo" nz-input rows="2" placeholder="write any thing"></textarea>
      </nz-form-control>
    </nz-form-item>

  </form>

  <ng-template #footerTpl>
    <div style="float: right">
      <button nz-button style="margin-right: 8px;" (click)="close()">取消</button>
      <button nz-button nzType="primary" (click)="submitForm()">保存</button>
    </div>
  </ng-template>

</nz-drawer>
